﻿<%@ Page Title="" Language="C#" MasterPageFile="~/vboard/manager/main.master" Inherits="VioletDevelopmentLaboratory.Net.Web.Configuration.VWebConfigManagerPage" %>

<script runat="server">

	protected void SmtpDetailsView_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
	{
		ShowAlert_DetailsView_ItemUpdated(e);
	}
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPlaceHolder" Runat="Server">
	<h2>Smtp</h2>

	<div>

		<asp:ObjectDataSource ID="SmtpObjectDataSource" runat="server" 
			SelectMethod="GetSmtpSection" 
			TypeName="VioletDevelopmentLaboratory.Net.Web.Configuration.SmtpSectionManager" 
			UpdateMethod="Modify">
			<UpdateParameters>
				<asp:Parameter Name="deliveryMethod" Type="Object" />
				<asp:Parameter Name="from" Type="String" />
			</UpdateParameters>
		</asp:ObjectDataSource>
		<fieldset>
			<legend>smtp</legend>
			<asp:DetailsView ID="SmtpDetailsView" runat="server" AutoGenerateRows="False" 
				DataSourceID="SmtpObjectDataSource"
				onitemupdated="SmtpDetailsView_ItemUpdated" DefaultMode="Edit">
				<Fields>
					<asp:TemplateField HeaderText="DeliveryMethod" SortExpression="DeliveryMethod">
						<EditItemTemplate>
							<asp:DropDownList ID="DeliveryMethodDropDownList" runat="server" SelectedValue='<%# Bind("DeliveryMethod") %>'>
								<asp:ListItem>Network</asp:ListItem>
								<asp:ListItem>SpecifiedPickupDirectory</asp:ListItem>
								<asp:ListItem>PickupDirectoryFromIis</asp:ListItem>
							</asp:DropDownList>
						</EditItemTemplate>
					</asp:TemplateField>
					<asp:BoundField DataField="From" HeaderText="From" SortExpression="From" />
					<asp:CommandField ButtonType="Button" ShowEditButton="True" ShowCancelButton="False" />
				</Fields>
			</asp:DetailsView>
		</fieldset>

		<div style="margin-left : 30px">
			<asp:ObjectDataSource ID="SpecifiedPickupDirectoryObjectDataSource" 
				runat="server" SelectMethod="GetSpecifiedPickupDirectoryElement" 
				TypeName="VioletDevelopmentLaboratory.Net.Web.Configuration.SmtpSectionManager" 
				UpdateMethod="ModifySpecifiedPickupDirectory">
				<UpdateParameters>
					<asp:Parameter Name="pickupDirectoryLocation" Type="String" />
				</UpdateParameters>
			</asp:ObjectDataSource>
			<fieldset>
			<legend>specifiedPickupDirectory</legend>
			<asp:DetailsView ID="SpecifiedPickupDirectoryDetailsView" runat="server" 
				AutoGenerateRows="False" DataSourceID="SpecifiedPickupDirectoryObjectDataSource" DefaultMode="Edit">
				<Fields>
					<asp:BoundField DataField="PickupDirectoryLocation" 
						HeaderText="PickupDirectoryLocation" SortExpression="PickupDirectoryLocation" />
					<asp:CommandField ButtonType="Button" ShowCancelButton="False" 
						ShowEditButton="True" />
				</Fields>
			</asp:DetailsView>
		</div>

		<div style="margin-left : 30px">
			<asp:ObjectDataSource ID="NetworkObjectDataSource" runat="server" 
				SelectMethod="GetNetworkElement" 
				TypeName="VioletDevelopmentLaboratory.Net.Web.Configuration.SmtpSectionManager" 
				UpdateMethod="ModifyNetword">
				<UpdateParameters>
					<asp:Parameter Name="host" Type="String" />
					<asp:Parameter Name="port" Type="Int32" />
					<asp:Parameter Name="defaultCredentials" Type="Boolean" />
					<asp:Parameter Name="userName" Type="String" />
					<asp:Parameter Name="password" Type="String" />
				</UpdateParameters>
			</asp:ObjectDataSource>
			<fieldset>
				<legend>specifiedPickupDirectory</legend>
				
				<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
					DataSourceID="NetworkObjectDataSource" DefaultMode="Edit">
					<Fields>
						<asp:BoundField DataField="Host" HeaderText="Host" SortExpression="Host" />
						<asp:BoundField DataField="Port" HeaderText="Port" SortExpression="Port" />
						<asp:CheckBoxField DataField="DefaultCredentials" 
							HeaderText="DefaultCredentials" SortExpression="DefaultCredentials" />
						<asp:BoundField DataField="UserName" HeaderText="UserName" 
							SortExpression="UserName" />
						<asp:BoundField DataField="Password" HeaderText="Password" 
							SortExpression="Password" />
						<asp:CommandField ButtonType="Button" ShowCancelButton="False" 
							ShowEditButton="True" />
					</Fields>
				</asp:DetailsView>
				
			</fieldset>
		</div>
	</div>
</asp:Content>